<?php

if (!defined('PHOX') or !constant('PHOX')) die('Direct access not allowed!');

/**
 * BaseView 
 * 
 * @uses ArrayObject
 * @package view
 * @version 0.1
 * @author Pedro Eugénio <voxmachina@sapo.pt> 
 * @license GPL v.3
 */
class BaseView extends ArrayObject
{
 
 /**
  * __construct 
  * 
  * @return void
  */
  public function __construct()
  {
    parent::__construct( array() , ArrayObject::ARRAY_AS_PROPS );
  }

 /**
  * render 
  * 
  * @param mixed $file 
  * @return void
  */
  public function render($file)
  {
    ob_start();
    $filepath  = ROOT_DIR.SEPARATOR.APP.SEPARATOR.TEMPLATES.SEPARATOR.$file.EXTENSION;
    include( $filepath );
    return ob_get_clean();
  }
}
?>
